///////////////////////////////////////////////////////////////////
// Student name:Jon Hersack and Caleb Reinking
// Course: COSC 3403
// Assignment: #7 - Initial Software Construction
// File name:Card.java
// Purpose:Defines the Card by the type ID number and returns string
// representation for UI.
// Assumptions:assumes only valid type IDS will be used
// Limitations:see assumptions
// Development Computer:Intel core2 duo 2.67Ghz
// Operating System: windows
// Integrated Development Environment (IDE): netbeans 6.5
// Compiler: Javac java 1.6.0_13
///////////////////////////////////////////////////////////////////


import java.util.*;


public class Card 
{

    int typeID;

    //contructors
    Card(){}//blank contructor

    Card(int i)
    {
        typeID=i;
    }

    //methods
    //#############################################
    int getTypeID()
    {
        return typeID;
    }//end getTypeID
    
    //#############################################
    void setTypeID(int ID)
    {
        typeID = ID;
    }//end getTypeID

    //#############################################
  int compareTo(Card c)
    {//returns 1 if equal typeID == ID
     //return -1 if not same card type
        if(typeID == c.getTypeID())
            return 1;
        else
            return -1;
    }//end getTypeID

   //#############################################
     Vector<String> toStringRep()
       {//returns a 2 line representation of the card
        Vector<String> stringVect = new Vector<String>(3);
        
        String cardType = new String();
        String cardValue1 = new String();
        String cardValue2 = new String();
        
        switch(typeID)
        {
            case 0:

                cardType = new String("");
                cardValue1 =new String("");
                break;
            case 1:

                cardType = new String("DIST");
                cardValue1 =new String("25");
                break;

            case 2:

                cardType = new String("DIST");
                cardValue1 =new String("50");
                break;

            case 3:

                cardType = new String("DIST");
                cardValue1 =new String("75");
                break;

            case 4:

                cardType = new String("DIST");
                cardValue1 =new String("100");
                break;

            case 5:

                cardType = new String("DIST");
                cardValue1=new String("200");
                break;

            case 6:

                cardType = new String("HAZARD");
                cardValue1=new String("OUT OF");
                cardValue2=new String("GAS");
                break;
                
            case 7:

                cardType = new String("HAZARD");
                cardValue1=new String("FLAT");
                cardValue2=new String("TIRE");
                break;

            case 8:

                cardType = new String("HAZARD");
                cardValue1=new String("ACCID");
                break;

            case 9:

                cardType = new String("HAZARD");
                cardValue1=new String("SPEED");
                cardValue1=new String("LIMIT");
                break;

            case 10:

                cardType = new String("HAZARD");
                cardValue1=new String("STOP");
                break;

            case 11:

                cardType = new String("REMEDY");
                cardValue1=new String("GAS");
                break;

            case 12:

                cardType = new String("REMEDY");
                cardValue1=new String("SPARE");
                cardValue2=new String("TIRE");
                break;

            case 13:

                cardType = new String("REMEDY");
                cardValue1=new String("REPAIR");
                break;

            case 14:

                cardType = new String("REMEDY");
                cardValue1=new String("END OF");
                cardValue2=new String("LIMIT");
                break;

            case 15:

                cardType = new String("REMEDY");
                cardValue1=new String("ROLL");
                break;

            case 16:

                cardType = new String("SAFETY");
                cardValue1=new String("EXTRA");
                cardValue2=new String("TANK");
                break;

            case 17:

                cardType = new String("SAFETY");
                cardValue1=new String("PUNCT");
                cardValue2=new String("PROOF");
                break;

            case 18:

                cardType = new String("SAFETY");
                cardValue1=new String("DRIVING");
                cardValue2=new String("ACE");
                break;

            case 19:

                cardType = new String("SAFETY");
                cardValue1=new String("RIGHT");
                cardValue2=new String("OF WAY");
                break;

        }//end switch
        
        stringVect.add(cardType);
        stringVect.add(cardValue1);
        stringVect.add(cardValue2);

        return stringVect;
    }//end getTypeID

     //self test main
     //##################################
    public static void main(String args[])
    {
        Card testCard;
        Card testCard2;

        Scanner conin = new Scanner(System.in);

        int type = conin.nextInt();

        testCard = new Card(type);
        testCard2 = new Card(18);

        Vector strings = testCard.toStringRep();


        System.out.println(strings.get(0));
        System.out.println(strings.get(1));
        System.out.println(strings.get(2));

        System.out.print("Card type: ");
        System.out.print(testCard.getTypeID());

        System.out.print(" :is 18: ");
        System.out.println(testCard.compareTo(testCard2));
        

        System.exit(0);

    }//end test main

}//end class Card
